<?php


namespace App\Config;


use App\Job\BankEntryDataVerifyJob;
use App\Job\ClassAmtRefreshJob;
use App\Job\ClassAmtStartJob;
use App\Job\ClassNettingJob;
use App\Job\DwJob;
use App\Job\LockHistoryJob;
use App\Job\PfsHeadAddBatchClassJob;
use App\Job\PfsHeadAddbatchtransferJob;
use App\Job\PfsHeadAddclassincrementJob;
use App\Job\PfsHeadAddclasslessonJob;
use App\Job\PfsHeadQueryAccountBalanceJob;
use App\Job\PfsHeadQueryClassBalanceJob;
use App\Job\PfsHeadQueryHostDetailJob;
use App\Job\PfsHeadQueryTransferBillJob;
use App\Job\PfsHeadQueryWithdrawProvisionJob;
use App\Job\PfsHeadWithdrawProvisionJob;

class QueueConfig
{

    /*银行信息-银行入账数据核对*/
    const BANK_ENTRYDATA_VERIFY = 'BANK_ENTRYDATA_VERIFY';
    /*数仓数据是否可用状态表处理进度记录表-更新任务进度*/
    const LOCK_HISTORY = 'LOCK_HISTORY';
    /*班级-当日 班级&账户 轧差净额*/
    const CLASS_NETTING = 'CLASS_NETTING';
    /*班级余额-刷新指定班级余额*/
    const CLASS_AMT_REFRESH = 'CLASS_AMT_REFRESH';
    /*触发班级拨付余额查询任务*/
    const CLASS_AMT_START = 'CLASS_AMT_START';

    /*3.10 班级拨付余额查询  机构端->银行*/
    const PFS_HEAD_QUERYCLASSBALANCE = 'PFS_HEAD_QUERYCLASSBALANCE';
    /*3.8 监管户余额查询   机构端 -> 银行*/
    const PFS_HEAD_QUERYACCOUNTBALANCE = 'PFS_HEAD_QUERYACCOUNTBALANCE';
    /*3.7监管户动账查询   机构端 -> 银行*/
    const PFS_HEAD_QUERYHOSTDETAIL = 'PFS_HEAD_QUERYHOSTDETAIL';
    /*3.6备份金退费借回结果查询   机构端 -> 招行*/
    const PFS_HEAD_QUERYWITHDRAWPROVISION = 'PFS_HEAD_QUERYWITHDRAWPROVISION';
    /*3.5备份金退费借回   机构端 -> 招行*/
    const PFS_HEAD_WITHDRAWPROVISION = 'PFS_HEAD_WITHDRAWPROVISION';
    /*3.3划拨/解冻结果查询   机构端 -> 招行*/
    const PFS_HEAD_QUERYTRANSFERBILL = 'PFS_HEAD_QUERYTRANSFERBILL';
    /*3.2招行-提出划拨/解冻   机构端 -> 招行*/
    const PFS_HEAD_ADDBATCHTRANSFER = 'PFS_HEAD_ADDBATCHTRANSFER';
    /*2.4 排课信息同步   机构端 -> 招行*/
    const PFS_HEAD_ADDCLASSLESSON = 'PFS_HEAD_ADDCLASSLESSON';
    /*2.3招行-售/退课汇总信息同步*/
    const PFS_HEAD_ADDCLASSINCREMENT = 'PFS_HEAD_ADDCLASSINCREMENT';
    /*2.1招行-班级信息同步*/
    const PFS_HEAD_ADDBATCHCLASS = 'PFS_HEAD_ADDBATCHCLASS';

    /*读取数仓中间库数据-获取要同步招行的数据*/
    const DW = 'DW';

    /*demo*/
    const DEMO = 'DEMO';


    /**
     * 即时队列任务
     *
     * @return string
     */
    public static function queue()
    {
        return config('cache.prefix') . ':' . CacheConfig::QUEUE;
    }

    /**
     * 延时队列任务
     *
     * @return string
     */
    public static function clock()
    {
        return config('cache.prefix') . ':' . CacheConfig::QUEUE_CLOCK;
    }

    /*
     * 注册任务队列空闲时,需要执行的任务
     * keep_time>=10    间隔时间,keep_time不可以小于10秒
     * ['keep_time' => 10, 'func' => \App\Job\DemoJob::class]
     * */
    const FREE = [
        /*划拨/解冻结果查询   机构端 -> 招行*/
        //['keep_time' => 600, 'func' => PfsHeadQueryTransferBillJob::class],
        /*备份金退费借回结果查询   机构端 -> 招行*/
        //['keep_time' => 600, 'func' => PfsHeadQueryWithdrawProvisionJob::class],
        /*3.7监管户动账查询   机构端 -> 银行*/
        ['keep_time' => 600, 'func' => PfsHeadQueryHostDetailJob::class],
        /*3.8 监管户余额查询   机构端 -> 银行*/
        ['keep_time' => 300, 'func' => PfsHeadQueryAccountBalanceJob::class],
        /*银行信息-银行入账数据核对*/
        ['keep_time' => 600, 'func' => BankEntryDataVerifyJob::class],
        /*3.10 班级拨付余额查询  机构端->银行*/
        //['keep_time' => 3000, 'func' => PfsHeadQueryClassBalanceJob::class],
    ];

    /*注册队列任务*/
    const REGISTER = [

        /*银行信息-银行入账数据核对*/
        QueueConfig::BANK_ENTRYDATA_VERIFY           => BankEntryDataVerifyJob::class,
        /*数仓数据是否可用状态表处理进度记录表-更新任务进度*/
        QueueConfig::LOCK_HISTORY                    => LockHistoryJob::class,
        /*班级-当日 班级&账户 轧差净额*/
        QueueConfig::CLASS_NETTING                   => ClassNettingJob::class,
        /*班级余额-刷新指定班级余额*/
        QueueConfig::CLASS_AMT_REFRESH               => ClassAmtRefreshJob::class,
        /*触发班级拨付余额查询任务*/
        QueueConfig::CLASS_AMT_START                 => ClassAmtStartJob::class,

        /*3.10 班级拨付余额查询  机构端->银行*/
        QueueConfig::PFS_HEAD_QUERYCLASSBALANCE      => PfsHeadQueryClassBalanceJob::class,
        /*3.8 监管户余额查询   机构端 -> 银行*/
        QueueConfig::PFS_HEAD_QUERYACCOUNTBALANCE    => PfsHeadQueryAccountBalanceJob::class,
        /*3.7监管户动账查询   机构端 -> 银行*/
        QueueConfig::PFS_HEAD_QUERYHOSTDETAIL        => PfsHeadQueryHostDetailJob::class,
        /*备份金退费借回结果查询   机构端 -> 招行*/
        QueueConfig::PFS_HEAD_QUERYWITHDRAWPROVISION => PfsHeadQueryWithdrawProvisionJob::class,
        /*备份金退费借回   机构端 -> 招行*/
        QueueConfig::PFS_HEAD_WITHDRAWPROVISION      => PfsHeadWithdrawProvisionJob::class,
        /*划拨/解冻结果查询   机构端 -> 招行*/
        QueueConfig::PFS_HEAD_QUERYTRANSFERBILL      => PfsHeadQueryTransferBillJob::class,
        /*招行-提出划拨/解冻   机构端 -> 招行*/
        QueueConfig::PFS_HEAD_ADDBATCHTRANSFER       => PfsHeadAddbatchtransferJob::class,
        /*2.4 排课信息同步   机构端 -> 招行*/
        QueueConfig::PFS_HEAD_ADDCLASSLESSON         => PfsHeadAddclasslessonJob::class,
        /*招行-售/退课汇总信息同步*/
        QueueConfig::PFS_HEAD_ADDCLASSINCREMENT      => PfsHeadAddclassincrementJob::class,
        /*招行-班级信息同步*/
        QueueConfig::PFS_HEAD_ADDBATCHCLASS          => PfsHeadAddBatchClassJob::class,

        /*读取数仓中间库数据-获取要同步招行的数据*/
        QueueConfig::DW                              => DwJob::class,

        /*demo: DemoService::main()*/
        QueueConfig::DEMO                            => \App\Job\DemoJob::class,
    ];

}





/**
 * QueueConfig.php
 *
 * 说明:
 *
 * 修改历史
 * ----------------------------------------
 * 2021/1/4 16:56:00   操作:创建
 **/
